package com.br.fsm.projectdelivery.repositorio;

public final class DBScript {
	
	public static String[] SCRIPT_DATABASE_CREATE = new String[] {
		// Script Usuario //
		"CREATE TABLE [USUARIO] (" +
		  " [USUR_ID] INTEGER PRIMARY KEY AUTOINCREMENT," +
		  " [EDRC_ID] INTEGER CONSTRAINT [FK1_USUARIO] REFERENCES [ENDERECO]([EDRC_ID]) ON DELETE RESTRICT ON UPDATE RESTRICT," +
		  " [USUR_NMUSUARIO] VARCHAR(50) NOT NULL," +
		  " [USUR_DSRG] VARCHAR(7) NOT NULL," +
		  " [USUR_DSCPF] VARCHAR(11) NOT NULL," +
		  " [USUR_DSEMAIL] VARCHAR(40) NOT NULL," +
		  " [USUR_DSLOGIN] VARCHAR(20) NOT NULL," +
		  " [USUR_DSSENHA] VARCHAR(15) NOT NULL," +
		  " [USUR_TMULTIMAALTERACAO] TIMESTAMP NOT NULL );",
		
		// Script Endereco //
		"CREATE TABLE [ENDERECO] (" +
		  " [EDRC_ID] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"+  
		  " [EDRC_DSLOGRADOURO] VARCHAR(50) NOT NULL," +
		  " [EDRC_NUMERO] INTEGER NOT NULL," +
		  " [EDRC_DSCOMPLEMENTO] VARCHAR(30) NOT NULL," +
		  " [EDRC_DSBAIRRO] VARCHAR(40) NOT NULL," +
		  " [EDRC_DSCIDADE] VARCHAR(40) NOT NULL," +
		  " [EDRC_DSESTADO] VARCHAR(40) NOT NULL," +
		  " [EDRC_DSCEP] VARCHAR(8) NOT NULL," +
		  " [EDRC_TMULTIMAALTERACAO] TIMESTAMP NOT NULL );"
	};
	
	public static String[] SCRIPT_DATABASE_DELETE = { 
		"DROP TABLE IF EXISTS USUARIO;",
		"DROP TABLE IF EXISTS ENDERECO;"
	};
}
